package com.bwie.controller;

import com.bwie.pojo.GroupJoin;
import com.bwie.service.GroupJoinService;
import com.bwie.service.impl.GroupJoinServiceImpl;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

/**
 * 商家拼团活动表(tb_group_join)表控制层
 *
 * @author xxxxx
 */
@RestController
@RequestMapping("/team/team")
public class GroupJoinController {
    /**
     * 服务对象
     */
    @Autowired
    private GroupJoinService groupJoinService;


    /**
     * @author: 鑫仔
     * @description: 商家拼团活动表
     * @params: [com.bwie.vo.PageInfoVo]
     * @return: com.bwie.utils.R
     * @date: 2025/7/27 20:46
     */
    @PostMapping("groupJoinList")
    public R groupJoinList(
            @RequestBody PageInfoVo pageInfoVo
    ) {
        return groupJoinService.groupJoinList(pageInfoVo);
    }

    /**
     * @author: 鑫仔
     * @description: 添加商家拼团活动
     * @params: [com.bwie.pojo.GroupJoin]
     * @return: com.bwie.utils.R
     * @date: 2025/7/28 17:28
     */
    @PostMapping("addGroupJoin")
    public R addGroupJoin(
            @RequestBody GroupJoin groupJoin
    ) {
        return groupJoinService.addGroupJoin(groupJoin);
    }


    /**
     * @author: 鑫仔
     * @description: 删除商家拼团活动
     * @params: []
     * @return: com.bwie.utils.R
     * @date: 2025/7/30 14:42
     */
    @PostMapping("deleteGroupJoin/{joinId}")
    public R deleteGroupJoin(
            @PathVariable(name = "joinId") Integer joinId
    ) {
        return groupJoinService.deleteGroupJoin(joinId);
    }

}
